package com.hoshino.momochi.service.Impl;

import com.hoshino.momochi.mapper.MessageMapper;
import com.hoshino.momochi.model.domain.Message;
import com.hoshino.momochi.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MessageServiceImpl implements MessageService {

    @Autowired
    private MessageMapper messageMapper;

    @Override
    public List<Message> findMessageByPullId(Long pullId) {
        return messageMapper.findMessageByPullId(pullId);
    }

    @Override
    public void addMessage(Message message) {
        messageMapper.addMessage(message);
    }

    @Override
    public List<Message> findMessageByUserId(Long uid) {
        return messageMapper.findMessageByUserId(uid);
    }

    @Override
    public void updateByIDAndSend(Long id) {
        messageMapper.updateByIDAndSend(id);
    }

    @Override
    public void updateByIDAndPull(Long id) {
        messageMapper.updateByIDAndPull(id);
    }

    @Override
    public List<Message> findMessagesBySendId(Long sendId) {
        return messageMapper.findMessagesBySendId(sendId);
    }

    @Override
    public void delIsDeleteAsTrue() {
        messageMapper.delIsDeleteAsTrue();
    }

    @Override
    public List<Message> getMessageByUser(Long aid, Long uid) {
        return messageMapper.getMessageByUser(aid, uid);
    }
}
